<?php
namespace App\Exceptions;

use Exception;

class ValidationException extends Exception {
    protected $code = 422;
    protected $errors = [];
    
    public function __construct($message = 'Validation failed', $errors = []) {
        parent::__construct($message, $this->code);
        $this->errors = $errors;
    }
    
    public function getErrors() {
        return $this->errors;
    }
}